<#--<#assign security=JspTaglibs["/WEB-INF/security.tld"] /> -->
<#-- Header -->
<div class="navbar">
    <div class="navbar-inner">
        <div class="container">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <a class="brand">yukari world</a>

            <div class="nav-collapse">
            
            	
            <#-- JS填充header数据 -->
                <ul class="nav" id="nav-header">
                    <li class="dropdown root_menu">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <span class="root_name">弹幕管理</span>
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <a class="navbar-title" href="${rc.contextPath}/admin/chatmsg/index">弹幕查询</a>
                            </li>
                            <li>
                                <a class="navbar-title" href="${rc.contextPath}/admin/auth/findIndex">用户详情</a>
                            </li>
                        </ul>
                    </li>
					<#if manageAuthLv <= 5>
                        <li class="dropdown root_menu">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <span class="root_name">小马管理</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/xiaoma/index">呼叫小马</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown root_menu">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <span class="root_name">夏季巡演</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/tour/draw/param">门票抽取</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/tour/list">用户信息</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/tour/ticketCode/index">兑换码生成</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/tour/qr">二维码检测</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/tour/code">数字码检测</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/tour/ticketCode">兑换码检测</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown root_menu">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <span class="root_name">抽奖管理</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/random/number">随机数生成器</a>
                                </li>
							<#--<li>-->
							<#--<a class="navbar-title" href="${rc.contextPath}/admin/random/yuba">鱼吧抽奖器</a>-->
							<#--</li>-->
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/draw/chatmsg/index">弹幕抽奖</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/draw/ticket/index">答题抽奖</a>
                                </li>
                                <!--
	            			<li>
	            				<a class="navbar-title" href="${rc.contextPath}/admin/draw/ticket/show" target="_blank">显示页</a>
	            			</li>
	            	-->
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/random/bilibili">bilibili评论抽奖</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/draw/christmas/createUrl">圣诞礼物抽奖链接生成器</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown root_menu">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <span class="root_name">投票管理</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/vote/index">弹幕投票</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown root_menu">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <span class="root_name">歌曲管理</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/music/list">会唱歌曲管理</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/music/sheet/list">直播歌单管理</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/music/random/single">抽奖小玩具</a>
                                </li>
                                <!--
	            			<li>
	            				<a class="navbar-title" href="${rc.contextPath}/admin/music/random/index">临时歌单管理</a>
	            			</li>
	            			-->
                            </ul>
                        </li>
                    </#if>
                    <#if manageAuthLv <= 12>
                        <li class="dropdown root_menu">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <span class="root_name">积分管理</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/score/exchange/list">礼物列表</a>
                                </li>
                                <#if manageAuthLv <= 5>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/register/index">签到列表</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/score/list">房管积分列表</a>
                                </li>
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/exchange/gfit/list">兑换管理</a>
                                </li>
                                </#if>
                            </ul>
                        </li>
                        <li class="dropdown root_menu">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <span class="root_name">房间管理</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/ban/index">禁言列表</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown root_menu">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <span class="root_name">贡品管理</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/cosmetics/list">任务列表</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown root_menu">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <span class="root_name">地址管理</span>
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a class="navbar-title" href="${rc.contextPath}/admin/address/list">地址列表</a>
                                </li>
                            </ul>
                        </li>
					</#if>

                </ul>


                <ul class="nav pull-right">
                    <li class="divider-vertical"></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-cog icon-white"></i>操作
                            <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="https://www.douyu196.com" target="blank">开播提醒</a></li>
                            <li><a href="${rc.contextPath}/login/out">登出</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<#-- /Header -->
<script type="text/javascript">
 /**
    $(document).ready(function () {
        //填充header
        var menus = $.backend.allMenuByName($.backend.opts.rootMenuName);
        var subMenus = menus.subMenus;

        var content = "";
        for (var i = 0; i < subMenus.length; i++) {
            var menu = subMenus[i].menu;
            var menus = subMenus[i].subMenus;
            // 有下拉菜单
            if (menus.length > 0) {
                content += '<li class="dropdown root_menu" id = "menu_' + menu.id + '">' +
                        '<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="root_name">'
                        + menu.name + '</span><b class="caret"></b></a><ul class="dropdown-menu">'
                for (var j = 0; j < menus.length; j++) {
                    content += '<li><a class="navbar-title" id = "menu_' + menus[j].menu.id + '" href="' + $.backend.opts.base + menus[j].menu.url + '">' + menus[j].menu.name + '</a></li>'
                }
                content += '</ul></li>'
            } else {
                content += '<li class="root_menu" id = "menu_' + menu.id + '"><a class="navbar-title" href="' + $.backend.opts.base + menu.url + '">' + menu.name + '</a></li>'
            }
        }

        $("#nav-header").html(content);
        // 用cookie显示欢迎信息
        var menu_active = $.cookie("manage_menu_active");
        // 用cookie回填选中
        console.log("cookie menu active: ", menu_active);
        if (menu_active != undefined) {
            $("#" + menu_active).parents(".root_menu").addClass("active");
        }

        $('.navbar-title').click(function () {
            // 设置cookie,当前选中的submenu是什么，下拉菜单
            var menuId = $(this).attr("id");
            console.log("u have click the sub menu, id:", menuId);
            $.cookie("manage_menu_active", menuId, { expires: 7, path: $.backend.opts.base});
        });
    });
    
    **/
</script>
